package org.bb.pack;
//自己写的转换包装类
public class pack {
	public static void main(String[] args) {

		int i1 = 10;
		// 基本转包装类
		Integer iI1 = new Integer(i1);
		Integer iI2 = i1;
		Integer iI3 = Integer.valueOf(i1);
		System.out.println("包装类iI1:" + iI1);
		System.out.println("包装类iI2:" + iI2);
		System.out.println("包装类iI3:" + iI3);
		// 包装类转基本类
		int i001 = iI1;
		int i002 = iI1.intValue();
		System.out.println("基本类i001:" + i001);
		System.out.println("基本类i002:" + i002);
		// 包转string
		String str01 = iI1.toString();
		String str02 = iI1 + "";
		System.out.println("String类str01:" + str01);
		System.out.println("String类str02:" + str02);
		//String转包
		String str03 = "1111";
		Integer iI4 = new Integer(i1);
		Integer iI5 = Integer.valueOf(str03, 2);//后一个值为输入的数的进制
		System.out.println("String转为包装类iI5:"+iI5);
		//基本转String
		int i10 = 16;
		String str10 = Integer.toString(i10,16);//后一个值为输出的进制
		System.out.println("基本转为Stringstr10:"+str10);
		
	}

}
